﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddNove.aspx.cs" Inherits="海漫思考核.AddNove" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>终点小说-管理员-新增小说</title>
    <style>
        #div_title{
            margin-top:50px;
            text-align:center;
            font-size:45px;
            font-family:FangSong;
            color:orange;
        }
        #div_content{
            width:500px;
            border:3px solid black;
            border-image:linear-gradient(to right,#48316d,#23b7cb) 1 10;
            margin: 100px auto;
            text-align:center;
            font-size:18px;
            font-family:FangSong;
        }
        #tab_add{
            border-collapse:collapse;
            width:500px;
        }
        #tab_add td{
            line-height:38px;
        }
        .btn{
            height:40px;
            width:200px;
            margin-top:5px;
            border-radius:3px;
            background-color:#79f6d6;
            box-shadow: 0 0 2px 1px #11112d;
        }
        .btn:hover{
            background-color:#0fcca9;
        }
        .textbox{
            height:30px;
            width:240px;
            border:none;
            border:1px solid black;
            border-image:linear-gradient(to right,#48316d,#23b7cb) 1 10;
        }
        #text_uptime{
            width:150px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div id="div_title">
            新增小说
        </div>
        <div id="div_content">
            <table id="tab_add" border="1">
                <tr>
                    <td>小说名称</td>
                    <td>
                        <input type="text" id="text_name" class="textbox" runat="server"/>
                    </td>
                </tr>
                <tr>
                    <td>作者名称</td>
                    <td>
                        <input type="text" id="text_author" class="textbox" runat="server"/>
                    </td>
                </tr>
                <tr>
                    <td>章节</td>
                    <td>
                        <input type="number" id="text_chapter" class="textbox" value="0" runat="server"/>
                    </td>
                </tr>
                <tr>
                    <td>上架时间</td>
                    <td>
                        <input type="date" id="text_uptime" runat="server"/>
                    </td>
                </tr>
                <tr>
                    <td>小说类别</td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddl_type" AutoPostBack="true">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>小说状态</td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddl_state" AutoPostBack="true">
                            <asp:ListItem Text="连载中" Value="0" />
                            <asp:ListItem Text="已完结" Value="1" />
                            <asp:ListItem Text="修整中" Value="2" />
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>小说图片</td>
                    <td>
                        <asp:FileUpload ID="FileUpload1" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:Button Text="新增" OnClientClick="return check()" OnClick="btn_add_Click" ID="btn_add" CssClass="btn" runat="server" />&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button Text="返回" ID="btn_back" OnClick="btn_back_Click" CssClass="btn" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
    <script>
        function check() {
            if (document.getElementById("text_name").value == "") {
                alert("小说名称不能为空！");
                return false;
            }
            if (document.getElementById("text_author").value == "") {
                alert("小说作者不能为空！");
                return false;
            }
            if (document.getElementById("text_chapter").value == "") {
                alert("章节不能为空！");
                return false;
            } else if (parseInt(document.getElementById("text_chapter").value) < 0) {
                alert("章节不能小于零！");
                return false;
            }
            if (document.getElementById("text_uptime").value == "") {
                alert("上架时间不能为空！");
                return false;
            }
            if (document.getElementById("FileUpload1").value == "") {
                alert("封面图片不能为空！");
                return false;
            }
            return true;
        }
    </script>
</body>
</html>
